package cn.iocoder.yudao.module.reading.controller.app.record.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.DecimalMax;

/**
 * 阅读记录创建 Request VO
 *
 * @author 芋道源码
 */
@Schema(description = "用户 APP - 阅读记录创建 Request VO")
@Data
public class ReadingRecordCreateReqVO {

    @Schema(description = "绘本ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "绘本ID不能为空")
    private Long bookId;

    @Schema(description = "关联计划ID", example = "1")
    private Long planId;

    @Schema(description = "最后阅读页码", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
    @NotNull(message = "最后阅读页码不能为空")
    @Min(value = 1, message = "页码最小值为1")
    private Integer lastPage;

    @Schema(description = "阅读进度", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.8")
    @NotNull(message = "阅读进度不能为空")
    @DecimalMin(value = "0.0", message = "阅读进度最小值为0")
    @DecimalMax(value = "1.0", message = "阅读进度最大值为1")
    private Double readingProgress;

    @Schema(description = "阅读时长（秒）", requiredMode = Schema.RequiredMode.REQUIRED, example = "300")
    @NotNull(message = "阅读时长不能为空")
    @Min(value = 0, message = "阅读时长不能为负数")
    private Integer readingTime;

    @Schema(description = "阅读模式", requiredMode = Schema.RequiredMode.REQUIRED, example = "image")
    @NotNull(message = "阅读模式不能为空")
    private String readingMode;

    @Schema(description = "是否完成阅读", requiredMode = Schema.RequiredMode.REQUIRED, example = "false")
    @NotNull(message = "是否完成阅读不能为空")
    private Boolean isCompleted;

}
